package com.yuanfeng.userms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanfeng.userms.dto.ShopVipUserDTO;
import com.yuanfeng.userms.entity.UserVipEntity;
import com.yuanfeng.userms.vo.ShopVipUserVO;
import com.yuanfeng.userms.vo.UserYgInfoVO;
import com.yuanfeng.userms.vo.VipUserListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName UserVipMapper
 * @Description 店铺会员表
 * @Author cyp
 * @Date 2023-06-05 13:54:13
 * @Version 1.0
 **/
@Mapper
public interface UserVipMapper extends BaseMapper<UserVipEntity> {

    /**
     * 查询店铺会员信息
     * @param userId
     * @param shopIdList
     * @return
     */
    List<ShopVipUserVO> queryVipUserBatch(@Param("userId") String userId, @Param("shopIdList") List<Integer> shopIdList);

    /**
     * 插入店铺会员信息
     * @param shopVipUsers
     */
    void insertBatch(@Param("records")List<ShopVipUserVO> shopVipUsers);

    /**
     * 查询店铺会员信息
     * @param userId
     * @param shopId
     * @return
     */
    ShopVipUserVO queryVipUser(@Param("userId") String userId,@Param("shopId") Integer shopId);

    /**
     * 添加店铺会员
     * @param shopAddVipUser
     */
    void addVipUser(ShopVipUserVO shopAddVipUser);

    /**
     * 分页查询店铺vip用户
     * @param page
     * @param param
     * @return
     */
    IPage<VipUserListVO> queryShopVipUser(Page<VipUserListVO> page,@Param("param") ShopVipUserDTO param);

    /**
     * 更新用户信息
     * @param param
     * @return
     */
    int updateByPrimaryKeySelective(@Param("param") ShopVipUserDTO param);

    /**
     * 查询店铺员工信息
     * @param userId
     * @return
     */
    UserYgInfoVO queryYgUser(@Param("userId") String userId);

    /**
     * 校验当前用户是否已经成为微客
     * @param regStart
     * @return
     */
    Integer queryUserVipStart(@Param("param")  Map<String, Object> regStart);

    /**
     * 增加微客信息
     * @param regStart
     */
    void addVkVip(@Param("param") Map<String, Object> regStart);

    /**
     * 查询审核微客列表
     * @param page
     * @param param
     * @return
     */
    IPage<VipUserListVO> queryShopNoVkVipUser(Page<VipUserListVO> page,@Param("param") ShopVipUserDTO param);

    void deleteUserVip();
}
